//
// Created by 吴喆 on 2020/3/1.
//

#ifndef SUMMER_CONSOLE_H
#define SUMMER_CONSOLE_H

#include <iostream>
#include <string>
/**
 * 用于输出控制台信息
 */
#define _INFO(out, _a, _f, _line) info(out, _a, _f, _line)
#define INFO(_a) _INFO(&std::cout, _a, __FILE__, __LINE__)
#define ERR(_a) _INFO(&std::cerr, _a, __FILE__, __LINE__)
class Console {
public:

    template <class T>
    static inline void info(T t, const char* text,const char *file, int line) {
        std::basic_ostream<char> &ostream = *t;
        ostream << "-------------------" << std::endl;
        ostream << "FILE:" << file << " LINE:" << line << std::endl;
        ostream << text << std::endl;
        ostream << "-------------------" << std::endl;
    }
    template <class T>
    static inline void info(T t, const std::string &text,const char *file, int line) {
        std::basic_ostream<char> &ostream = *t;
        ostream << "-------------------" << std::endl;
        ostream << "FILE:" << file << " LINE:" << line << std::endl;
        ostream << text << std::endl;
        ostream << "-------------------" << std::endl;
    }


private:


};


#endif //SUMMER_CONSOLE_H
